package com.house.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.house.entity.Area;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AreaMapper extends BaseMapper<Area> {

    @Select("select area_id, parent_id, area_name, level, level_name, create_time, update_time from area order by area_id asc")
    List<Area> selectAreas();

    @Delete("delete from area where area_id = #{areaId}")
    int delete(int areaId);
}
